﻿using System;

namespace BruteForceSerializer.SL.Tests
{
	public static class ArrayExtensions
	{
		public static bool ArrayEquals(this Array array1, Array array2)
		{
			if (array1 == null && array2 == null)
				return true;
			if (array1 == null || array2 == null)
				return false;
			if (array1.Length != array2.Length)
				return false;
			for (int i = 0; i < array1.Length; i++)
				if (!array1.GetValue(i).Equals(array2.GetValue(i)))
					return false;
			return true;
		}
	}
}
